import express from 'express'
import { getUserInfo,updateAvatar,updateUserInfo, updateUserPwd } from '../router_handler/userInfo.js'
import expressJoi from '../utils/expressjoi.js'
import { update_avatar_schema, update_userInfo_schema, update_userPwd_schema } from '../schema/schema-user.js'
const router = express.Router()

// 查询用户信息的接口
router.get('/userinfo',getUserInfo)
// 更新用户信息接口
router.post('/userinfo',expressJoi(update_userInfo_schema),updateUserInfo)
// 修改用户密码接口
router.post('/updatepwd',expressJoi(update_userPwd_schema),updateUserPwd)
// 修改用户头像接口
router.post('/update/avatar',expressJoi(update_avatar_schema),updateAvatar)
export default router